#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
#include<string.h>
#include<unistd.h>

int main(){
  const char* arr1="Hello linux";
  char buffer[128];
  FILE* f1=fopen("bite","w");
  if(f1==NULL){
    printf("fopen failed\n");
    return 1;
  }
  if(fprintf(f1,"%s",arr1)<0){
    perror("write failed\n");
    return 2;
  }
  fclose(f1);
  f1=fopen("bite","r");
  fgets(buffer,sizeof(buffer),f1);
  printf("buffer:%s\n",buffer);
  fclose(f1);


  return 0;
}
